﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;

namespace HomeBuhApp
{
	public class PageWithProfile : Page
	{
		protected ProfileClass Profile = new ProfileClass();
	}

	public class ProfileClass
	{
		public string FirstName
		{
			get
			{
				if(HttpContext.Current.Profile["FirstName"] == null)
					return string.Empty;
				return (string) HttpContext.Current.Profile["FirstName"];
			}
			set { HttpContext.Current.Profile["FirstName"] = value; }
		}

		public string LastName
		{
			get
			{
				if (HttpContext.Current.Profile["LastName"] == null)
					return string.Empty;
				return (string)HttpContext.Current.Profile["LastName"];
			}
			set { HttpContext.Current.Profile["LastName"] = value; }
		}

		public DateTime DateOfBirth
		{
			get
			{
				if (HttpContext.Current.Profile["DateOfBirth"] == null)
					return DateTime.Now;
				return (DateTime)HttpContext.Current.Profile["DateOfBirth"];
			}
			set { HttpContext.Current.Profile["DateOfBirth"] = value; }
		}
	}
}